//
//  CPSCWaterfallLayout.h
//  CollTest
//
//  Created by codew on 9/12/21.
//

#import <UIKit/UIKit.h>

@class CPSCWaterfallLayout;

@protocol CPSCWaterfallLayoutDelegate <NSObject>

@required
/** 每一个item的高度 */
- (CGFloat)waterflowLayout:(CPSCWaterfallLayout *)waterflowLayout heightForItemAtIndex:(NSUInteger)index itemWidth:(CGFloat)itemWidth;

@optional
/** 列数 */
- (CGFloat)columnCountInWaterflowLayout:(CPSCWaterfallLayout *)waterflowLayout;
/** 每一列之间的间隙 */
- (CGFloat)columnMarginInWaterflowLayout:(CPSCWaterfallLayout *)waterflowLayout;
/** 每一行之间的间隙 */
- (CGFloat)rowMarginInWaterflowLayout:(CPSCWaterfallLayout *)waterflowLayout;
/** 每一个item 上下左右 的间隙 */
- (UIEdgeInsets)edgeInsetsInWaterflowLayout:(CPSCWaterfallLayout *)waterflowLayout;

@end

@interface CPSCWaterfallLayout : UICollectionViewLayout

@property (nonatomic, weak) id<CPSCWaterfallLayoutDelegate> delegate;

@end
